import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["className", "title", "col", "layout", "gutter", "children", "size"];
import React from 'react';
import classNames from 'classnames';
import { Row } from 'antd';
import styles from "./index.less?modules";

var DescriptionList = function DescriptionList(_ref) {
  var _classNames;

  var className = _ref.className,
      title = _ref.title,
      _ref$col = _ref.col,
      col = _ref$col === void 0 ? 3 : _ref$col,
      _ref$layout = _ref.layout,
      layout = _ref$layout === void 0 ? 'horizontal' : _ref$layout,
      _ref$gutter = _ref.gutter,
      gutter = _ref$gutter === void 0 ? 32 : _ref$gutter,
      children = _ref.children,
      size = _ref.size,
      restProps = _objectWithoutProperties(_ref, _excluded);

  var clsString = classNames(styles.descriptionList, styles[layout], className, (_classNames = {}, _defineProperty(_classNames, styles.small, size === 'small'), _defineProperty(_classNames, styles.large, size === 'large'), _classNames));
  var column = col > 4 ? 4 : col;
  return /*#__PURE__*/React.createElement("div", Object.assign({
    className: clsString
  }, restProps), title ? /*#__PURE__*/React.createElement("div", {
    className: styles.title
  }, title) : null, /*#__PURE__*/React.createElement(Row, {
    gutter: gutter
  }, React.Children.map(children, function (child) {
    return React.cloneElement(child, {
      column: column
    });
  })));
};

export default DescriptionList;